<!--
 * @Author: CoderLPF
 * @Date: 2020-03-17 10:38:15
 * @LastEditTime: 2020-04-21 10:56:45
 * @LastEditors: CoderLPF
 * @Description: 
 * @FilePath: \fzx-system-fd\src\views\main.vue
 -->
<template>
  <el-container>
    <el-header height="40px">
      <my-header></my-header>
    </el-header>
    <el-header height="40px" style="background-color:#1296db;height:40px;">
      <my-menu></my-menu>
    </el-header>
    <el-main>
      <router-view></router-view>
    </el-main>
    <el-footer height="30px">
      <my-footer></my-footer>
    </el-footer>
  </el-container>
</template>

<script>
import myHeader from "../components/common/header";
import myFooter from "../components/common/footer";
import myMenu from "../components/common/menu";

export default {
  components: { myHeader, myFooter, myMenu },

  created() {
    this.$api.user.getRoleList().then(res => {
      if (res.code || res.code == 200) {
        this.$store.commit("saveRoleList", res.data);
      }
    });

    this.$api.project
      .queryTenders({ subjectId: this.$store.state.projectInfo.projectName })
      .then(res => {
        if (res.code === 200) {
          this.$store.commit("dictTenders", res.data);
        }
      })
      .catch(err => {
        console.log(err);
      });

    this.$api.dict
      .getbytype("major_type")
      .then(res => {
        this.$store.commit("dictMajors", res.data);
      })
      .catch(err => {
        console.log(err);
      });
  }
};
</script>

<style lang="less" scoped>
.el-container {
  height: 100%;
  .el-header {
    padding: 0px;
  }

  .el-main {
    padding: 5px;
		margin-top: 3px;
		height: calc(~"100% - 120px");
    // div {
    //   height: 100%;
    // }
  }

  .el-footer {
    padding: 0px;
  }
}
</style>
